﻿<%@ Page Language="C#" MasterPageFile="~/SiteAdmin/MasterPage.master" AutoEventWireup="true" CodeFile="WorkflowCategory.aspx.cs" Inherits="SiteAdmin_WorkflowCategory" Title="Untitled Page" Theme="DefaultSkin" %>
<%@ Register src="../Controls/TipMessage/TipMessage.ascx" tagname="TipMessage" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contentPlaceHolderID" Runat="Server">
<asp:Panel ID="pnlGrid" runat="server" CssClass="centerPanel" Width="95%">
    <div class="webPanelBorder">
        <div class="webPanelCaption">工作流分类管理</div>
        <div class="webPanelContent">
        <ofcc:GridView ID="gridView" runat="server" AutoGenerateColumns="False" OnRowDataBound="gridView_RowDataBound" OnSplitPageIndexChange="gridView_SplitPageIndexChange">
            <Columns>
                <asp:TemplateField HeaderText="选择">
                    <ItemTemplate>
                        <input id="CategoryID" name="CategoryID" type="radio" value='<%#DataBinder.Eval(Container.DataItem,"CategoryID")%>'  />
                    </ItemTemplate>
                    <HeaderStyle Width="40px" />
                </asp:TemplateField>
			    <asp:BoundField DataField="GroupCodeName" HeaderText="类别" />			    
			    <asp:BoundField DataField="Subject" HeaderText="标题" />
			    <asp:BoundField DataField="CategoryCode" HeaderText="代码" />
			    <asp:BoundField DataField="OrderIndex" HeaderText="序号" />
			    <asp:BoundField DataField="ActivityPage" HeaderText="关联页面" />
                <asp:BoundField DataField="IsUsed" HeaderText="是否使用" />
            </Columns>
        </ofcc:GridView>
        </div>
    </div>
    <div class="webPanelButtonArea">
        <ofcc:LinkButton ID="btnAdd" runat="server" CssClass="linkButton" 
            OnClientClick="return validateCheckOne('DocumentID');" onclick="btnAdd_Click" >新建</ofcc:LinkButton>
        <ofcc:LinkButton ID="btnEdit" runat="server" CssClass="linkButton" 
            OnClientClick="return validateCheckOne('DocumentID');" onclick="btnEdit_Click" >修改</ofcc:LinkButton>
        <ofcc:LinkButton ID="btnRemove" runat="server" CssClass="linkButton" 
            ConfirmMessage="确定要删除吗?" onclick="btnRemove_Click" >删除</ofcc:LinkButton>  
    </div>
</asp:Panel>

        
<asp:Panel ID="pnlEdit" runat="server" Width="600px" Visible="false" CssClass="centerPanel">
<uc1:TipMessage ID="tipMessage1" runat="server" style="width:594px;" />
<div class="webPanelBorder" >
    <div class="webPanelCaption">工作流分类管理</div>
    <div class="webPanelContent">
        <table cellspacing="1" class="table">
            <tr>
                <td class="tableSubjectWidth">标题：
                </td>
                <td><asp:TextBox ID="tbSubject" runat="server" CssClass="shortInput" MaxLength="36" ></asp:TextBox>
                    <ofcc:RequiredField ID="RequiredField1" runat="server" />
                </td>
            </tr>
            <tr>
                <td>代码：<ofcc:ToolTip ID="ToolTip1" runat="server" CssClass="tip" ToolTip="只接受英文字母和数字, 代码必须唯一" /></td>
                <td><asp:TextBox ID="tbCategoryCode" runat="server" CssClass="shortInput" MaxLength="15"></asp:TextBox>
                    <ofcc:RequiredField ID="RequiredField2" runat="server" />
                </td>
            </tr>
            <tr>
                <td>序号：</td>
                <td><asp:TextBox ID="tbOrderIndex" runat="server" CssClass="shortInput" MaxLength="4"></asp:TextBox>
                    <ofcc:RequiredField ID="RequiredField3" runat="server" />
                </td>
            </tr>
            <tr>
                <td>类别：</td>
                <td>
                    <ofcc:DropDownList ID="ddlGroupCode" runat="server" CssClass="shortInput" Width="305">
                    </ofcc:DropDownList>
                </td>
            </tr>
            <tr>
                <td>关联控件：</td>
                <td><asp:TextBox ID="tbActivityPage" runat="server" CssClass="shortInput"></asp:TextBox></td>
            </tr>
            <tr>
                <td>流程图：</td>
                <td><asp:FileUpload runat="server" ID="fileUpload" /><br />
                <asp:Image runat="server" ID="imageFlow" Height="200" />
                </td>
            </tr>
            <tr>
                <td>备注：</td>
                <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:DropDownList ID="ddlActivityType" runat="server" Width="155">
                    </asp:DropDownList>
                    <asp:Button ID="btnFillTree" runat="server" Text="查看流程" onclick="btnFillTree_Click" />
                    <asp:TreeView ID="treeFlow" runat="server">
                    </asp:TreeView>
                </ContentTemplate>
                </asp:UpdatePanel>
                <asp:TextBox ID="tbDescription" runat="server" CssClass="shortInput" Rows="5" MaxLength="100" TextMode="MultiLine"></asp:TextBox><br />
                <ofcc:CheckBox ID="cbIsUsed" runat="server" Text="是否允许使用" />
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="webPanelButtonArea">
    <ofcc:LinkButton ID="btnSave" runat="server" OnClick="btnSave_Click" CssClass="linkButton" ValidationGroup="submit">保存</ofcc:LinkButton>
    <ofcc:LinkButton ID="btnCancel" runat="server" OnClick="btnCancel_Click"  CssClass="linkButton">取消</ofcc:LinkButton>
</div>
<asp:HiddenField ID="hfAddOrEdit" runat="server" />
<asp:HiddenField ID="hfCategoryID" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbSubject"
    Display="None" ErrorMessage="请输入标题" ValidationGroup="submit"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbCategoryCode"
    Display="None" ErrorMessage="请输入代码" ValidationGroup="submit"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator Enabled="false" ID="RegularExpressionValidator2" runat="server" ErrorMessage="无效的代码" ControlToValidate="tbCategoryCode" Display="None" ValidationExpression="[A-Za-z0-9_-]{2,36}" ValidationGroup="submit"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="无效的序号" ControlToValidate="tbOrderIndex" Display="None" ValidationExpression="[0-9]{1,4}" ValidationGroup="submit"></asp:RegularExpressionValidator>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableViewState="False"
    ShowMessageBox="True" ShowSummary="False" ValidationGroup="submit" />
</asp:Panel>
</asp:Content>

